package com.vicene.gmail.coupon;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;

/**
 * 配置中心配置
 * 1：启动nacos-server
 * 2：bootstrap.properties增加配置
 *  spring.application.name=gmail-coupon
 *  spring.cloud.nacos.config.server-addr=127.0.0.1:8848
 * 3：yml增加配置
 *         <dependency>
 *             <groupId>com.alibaba.cloud</groupId>
 *             <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
 *         </dependency>
 * 4：给配置中心默认添加数据集（data id）gmail—coupon.properties, 服务名.properties
 * 5：动态获取配置
 *  @RefreshScope：动态刷新
 *  @Value("${配置项的名}")
 *  如果配置中心和当前应用的配置文件中都配置了相同的项，优先使用配置中心配置
 */
@EnableDiscoveryClient
@MapperScan("com.vicene.gmail.coupon.dao")
@SpringBootApplication
public class GmailCouponApplication {

    public static void main(String[] args) {
        SpringApplication.run(GmailCouponApplication.class, args);
    }

}
